<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>The MongoWriteConcernException class</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="class.mongoexecutiontimeoutexception.html">« MongoExecutionTimeoutException</a></li>
      <li style="float: right;"><a href="mongowriteconcernexception.getdocument.html">MongoWriteConcernException::getDocument »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="mongo.exceptions.html">Exceptions</a></li>
    <li>The MongoWriteConcernException class</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="class.mongowriteconcernexception" class="reference">

 <h1 class="title">The MongoWriteConcernException class</h1>
 

 <div class="partintro"><p class="verinfo">(PECL mongo &gt;= 1.5.0)</p>


  <div class="section" id="mongowriteconcernexception.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    MongoWriteConcernException is thrown when a write fails. See <a href="mongo.writeconcerns.html" class="xref">Write Concerns</a> for how to set failure thresholds.
   </p>
   <p class="para">
    Prior to MongoDB 2.6.0, the <a href="https://docs.mongodb.com/manual/reference/command/getLastError" class="link external">&raquo;&nbsp;getLastError</a> command would determine whether a write failed.
   </p>
  </div>


  <div class="section" id="mongowriteconcernexception.synopsis">
   <h2 class="title">Class synopsis</h2>


   <div class="classsynopsis">
    <div class="ooclass"></div>


    <div class="classsynopsisinfo">
     <span class="ooclass">
      <strong class="classname">MongoWriteConcernException</strong>
     </span>
     
     <span class="ooclass">
      <span class="modifier">extends</span>
      <a href="class.mongocursorexception.html" class="classname">MongoCursorException</a>
     </span>
     {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited properties */</div>
    <div class="fieldsynopsis">
     <span class="modifier">protected</span>
     <span class="type">string</span>
      <var class="varname"><a href=".html#exception.props.message">$<var class="varname">message</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">protected</span>
     <span class="type">int</span>
      <var class="varname"><a href=".html#exception.props.code">$<var class="varname">code</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">protected</span>
     <span class="type">string</span>
      <var class="varname"><a href=".html#exception.props.file">$<var class="varname">file</var></a></var>;</div>
<div class="fieldsynopsis"><span class="modifier">protected</span>
     <span class="type">int</span>
      <var class="varname"><a href=".html#exception.props.line">$<var class="varname">line</var></a></var>;</div>


    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="mongowriteconcernexception.getdocument.html" class="methodname">getDocument</a></span>(): <span class="type">array</span></div>

    
    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Inherited methods */</div>
    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="mongocursorexception.gethost.html" class="methodname">MongoCursorException::getHost</a></span>(): <span class="type">string</span></div>


   }</div>


  </div>

 </div>

 








<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="mongowriteconcernexception.getdocument.html">MongoWriteConcernException::getDocument</a> — Get the error document</li></ul>
</div>
</div></div></body></html>